﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HidesaburoDotNET.Core.AI;

namespace HidesaburoDotNET.Core
{
    public class FieldBuilder
    {
        List<Player> players;

        public FieldBuilder()
        {
            players = new List<Player>();
        }

        public void AddPlayer(Player player)
        {
            players.Add(player);
        }
        public Player AddHuman()
        {
            Human human = new Human();
            Player p = new Player();
            p.AI = human;
            AddPlayer(p);
            return p;
        }

        public Field CreateField()
        {
            //指定人数に足りない場合はダミーをセット
            if (players.Count < 4)
            {
                while (players.Count < 4)
                {
                    Player p = new Player();
                    p.AI = new DammyAI();
                    players.Add(p);
                }
            }

            Field field = new Field(players.ToArray());

            return field;

        }
    }
}
